home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98a.txt / 000137_icon-group-sender _Mon Mar 16 12:30:37 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id MAA06437
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 16 Mar 1998 12:30:37 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA19556; Mon, 16 Mar 1998 12:30:36 -0700
  7. Message-Id: <350D4D2D.30DC@gte.net>
  8. Date: Mon, 16 Mar 1998 10:02:53 -0600
  9. From: Mark Evans <evans@gte.net>
  10. Reply-To: evans@gte.net
  11. Organization: None
  12. X-Mailer: Mozilla 3.01 (Win95; I)
  13. Mime-Version: 1.0
  14. To: icon-group@optima.CS.Arizona.EDU
  15. Subject: Re: Letter Probabilities
  16. References: <199803151331.GAA18413@orpheus.gemini.edu>
  17. Content-Type: text/plain; charset=us-ascii
  18. Content-Transfer-Encoding: 7bit
  19. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  20. Status: RO
  21. Content-Length: 722
  22.  
  23. Finally someone answered my question!  Thanks, Steve!
  24.  
  25. If your alphabet has three letters {A,B,C} with probabilities
  26. {0.50,0.20,0.30} respectively then a table like this --
  27.  
  28. A   0.5
  29. C   0.3
  30. B   0.2
  31.  
  32. can be used to make random text.  I am not arguing that it's more
  33. elegant than the Icon ?string construct as everyone seems to imagine.
  34.  
  35. The random number x in [0,1] has uniform distribution.  By turns,
  36. subtract each number in the table until x <= 0, and there is your
  37. letter.  This technique would not work if x had nonuniform distribution.
  38.  
  39. For the record I suppose I should say that I like the generator string
  40. idea better myself, thought of it before getting on the newgroup here,
  41. and still think highly of it.
  42.  
  43. Mark
  44.  
  45.